3.1.87 \(\int \frac {1}{1+\pi x-3 x^2} \, dx\) [87]

Optimal. Leaf size=27 \[ -\frac {2 \tanh ^{-1}\left (\frac {\pi -6 x}{\sqrt {12+\pi ^2}}\right )}{\sqrt {12+\pi ^2}} \]

[Out]

-2*arctanh((Pi-6*x)/(Pi^2+12)^(1/2))/(Pi^2+12)^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {632, 212} \begin {gather*} -\frac {2 \tanh ^{-1}\left (\frac {\pi -6 x}{\sqrt {12+\pi ^2}}\right )}{\sqrt {12+\pi ^2}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(1 + Pi*x - 3*x^2)^(-1),x]

[Out]

(-2*ArcTanh[(Pi - 6*x)/Sqrt[12 + Pi^2]])/Sqrt[12 + Pi^2]

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 632

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rubi steps

\begin {align*} \int \frac {1}{1+\pi x-3 x^2} \, dx &=-\left (2 \text {Subst}\left (\int \frac {1}{12+\pi ^2-x^2} \, dx,x,\pi -6 x\right )\right )\\ &=-\frac {2 \tanh ^{-1}\left (\frac {\pi -6 x}{\sqrt {12+\pi ^2}}\right )}{\sqrt {12+\pi ^2}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 29, normalized size = 1.07 \begin {gather*} \frac {2 \tanh ^{-1}\left (\frac {-\pi +6 x}{\sqrt {12+\pi ^2}}\right )}{\sqrt {12+\pi ^2}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(1 + Pi*x - 3*x^2)^(-1),x]

[Out]

(2*ArcTanh[(-Pi + 6*x)/Sqrt[12 + Pi^2]])/Sqrt[12 + Pi^2]

________________________________________________________________________________________

Maple [A]
time = 0.59, size = 26, normalized size = 0.96

method result size
default \(\frac {2 \arctanh \left (\frac {-\pi +6 x}{\sqrt {\pi ^{2}+12}}\right )}{\sqrt {\pi ^{2}+12}}\) \(26\)
risch \(\frac {\ln \left (\pi ^{2}-\pi \sqrt {\pi ^{2}+12}+6 x \sqrt {\pi ^{2}+12}+12\right )}{\sqrt {\pi ^{2}+12}}-\frac {\ln \left (-\pi ^{2}-\pi \sqrt {\pi ^{2}+12}+6 x \sqrt {\pi ^{2}+12}-12\right )}{\sqrt {\pi ^{2}+12}}\) \(73\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(Pi*x-3*x^2+1),x,method=_RETURNVERBOSE)

[Out]

2/(Pi^2+12)^(1/2)*arctanh((-Pi+6*x)/(Pi^2+12)^(1/2))

________________________________________________________________________________________

Maxima [A]
time = 0.29, size = 39, normalized size = 1.44 \begin {gather*} -\frac {\log \left (\frac {\pi - 6 \, x + \sqrt {\pi ^{2} + 12}}{\pi - 6 \, x - \sqrt {\pi ^{2} + 12}}\right )}{\sqrt {\pi ^{2} + 12}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(pi*x-3*x^2+1),x, algorithm="maxima")

[Out]

-log((pi - 6*x + sqrt(pi^2 + 12))/(pi - 6*x - sqrt(pi^2 + 12)))/sqrt(pi^2 + 12)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 51 vs. \(2 (23) = 46\).
time = 1.94, size = 51, normalized size = 1.89 \begin {gather*} \frac {\log \left (-\frac {\pi ^{2} - 6 \, \pi x + 18 \, x^{2} - {\left (\pi - 6 \, x\right )} \sqrt {\pi ^{2} + 12} + 6}{\pi x - 3 \, x^{2} + 1}\right )}{\sqrt {\pi ^{2} + 12}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(pi*x-3*x^2+1),x, algorithm="fricas")

[Out]

log(-(pi^2 - 6*pi*x + 18*x^2 - (pi - 6*x)*sqrt(pi^2 + 12) + 6)/(pi*x - 3*x^2 + 1))/sqrt(pi^2 + 12)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 76 vs. \(2 (26) = 52\).
time = 0.13, size = 76, normalized size = 2.81 \begin {gather*} \frac {\log {\left (x - \frac {\pi }{6} + \frac {\pi ^{2}}{6 \sqrt {\pi ^{2} + 12}} + \frac {2}{\sqrt {\pi ^{2} + 12}} \right )}}{\sqrt {\pi ^{2} + 12}} - \frac {\log {\left (x - \frac {\pi }{6} - \frac {2}{\sqrt {\pi ^{2} + 12}} - \frac {\pi ^{2}}{6 \sqrt {\pi ^{2} + 12}} \right )}}{\sqrt {\pi ^{2} + 12}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(pi*x-3*x**2+1),x)

[Out]

log(x - pi/6 + pi**2/(6*sqrt(pi**2 + 12)) + 2/sqrt(pi**2 + 12))/sqrt(pi**2 + 12) - log(x - pi/6 - 2/sqrt(pi**2
 + 12) - pi**2/(6*sqrt(pi**2 + 12)))/sqrt(pi**2 + 12)

________________________________________________________________________________________

Giac [A]
time = 0.71, size = 45, normalized size = 1.67 \begin {gather*} -\frac {\log \left (\frac {{\left | -\pi + 6 \, x - \sqrt {\pi ^{2} + 12} \right |}}{{\left | -\pi + 6 \, x + \sqrt {\pi ^{2} + 12} \right |}}\right )}{\sqrt {\pi ^{2} + 12}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(pi*x-3*x^2+1),x, algorithm="giac")

[Out]

-log(abs(-pi + 6*x - sqrt(pi^2 + 12))/abs(-pi + 6*x + sqrt(pi^2 + 12)))/sqrt(pi^2 + 12)

________________________________________________________________________________________

Mupad [B]
time = 0.42, size = 23, normalized size = 0.85 \begin {gather*} -\frac {2\,\mathrm {atanh}\left (\frac {\Pi -6\,x}{\sqrt {\Pi ^2+12}}\right )}{\sqrt {\Pi ^2+12}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(Pi*x - 3*x^2 + 1),x)

[Out]

-(2*atanh((Pi - 6*x)/(Pi^2 + 12)^(1/2)))/(Pi^2 + 12)^(1/2)

________________________________________________________________________________________